<!doctype html>
<html class="no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title>福娃总排行榜</title>
	<meta name="renderer" content="webkit">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{ static_url("javascript/notify/animate.css") }}" type="text/css">
	<link rel="stylesheet" href="{{ static_url("amazeui/css/amazeui.min.css") }}">
    <link rel="stylesheet" href="{{ static_url("amazeui/css/youxi_style.css") }}">
    <link rel="stylesheet" href="{{ static_url("amazeui/css/rem_style.css") }}">
</head>
<body>
    <div class="am-page" id="">
        <div class="yx-content yx-content-style" id="yx-topall">
            <div id="yx-top-bg"></div>
            <div id="xy-top-myplace">
            </div>
            <div id="toplist" class="yx-top-list">
                <ul id = "toplistu">
                </ul>
            </div>
        </div>
	</div>
</body>
<script src="http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="{{ static_url("amazeui/js/amazeui.min.js") }}"></script>
<script src="{{ static_url("amazeui/js/rem.js") }}"></script>
<script src="{{ static_url("javascript/spin.min.js") }}"></script>
<script src="{{ static_url("javascript/notify/bootstrap-notify.min.js") }}"></script>
<script src="{{ static_url("javascript/main.min.js") }}"></script>
<script>
    $(function() {
        var uid = '{{ userid }}';
        requestData("/stat/list", 'get', {user_id:uid, isAjax:1}, 'xy-top-myplace', function(stat, data) {
            if (stat == 'failure') {
                htmlnull = "<div class='am-cf xy-top-myplace' style='text-align:center;'>系统繁忙，请稍候再试...</div>";
                $('#yx-topall').html(htmlnull);
            } else {
                var res = data.data;
                var user = false;
                $('#yx-top-bg').hide();
                $('#xy-top-myplace').hide()
                $('#toplist').hide();
                for (i = 0; i < res.length; i++) {
                    var topl = i+1;
                    if (i == 0) {
                        html_one =  "<div class='yx-top-bg'>"+
                            "<a href='http://wsim.66boss.com/toplist/fuwa_info.html?user="+res[i][0]+"'>"+
                            "<div class='yx-top-ouser'>"+
                            "<img id='championimage' src='"+res[i][3]+"' />"+
                            "</div>" +
                            "<div id='championname' class='yx-top-oname'>" +
                            "<span>" + res[i][2] + "</span>" +
                            "</div>" +
                            "<div class='xy-champion'>" + "冠军" +
                            "</div>" +
                            "</a>" +
                            "</div>";
                        $('#yx-top-bg').html(html_one);
                    }

                    if (uid == res[i][0]) {
                        user = true;
                        html_my = "<div class='am-cf xy-top-myplace'>" +
                            "<a href='http://wsim.66boss.com/toplist/fuwa_info.html?user=" + res[i][0] + "'>" +
                            "<div class='xy-top-ranking'>" + topl + "</div>" +
                            "<img src='" + res[i][3] + "' class='xy-mess-face'/>" +
                            "<div class='xy-mess-name'>" + res[i][2] + "</div>" +
                            "<div class='xy-mess-nums'>" + "共" + res[i][1] + "个福娃" + "</div>" +
                            "</a>" +
                            "</div>";
							$('#xy-top-myplace').html(html_my);
                    }

                    var html_top = "<li class='am-cf xy-top-listcont'>" +
                        "<a href='http://wsim.66boss.com/toplist/fuwa_info.html?user=" + res[i][0] + "'>" +
                        "<div class='xy-top-ranking'>" + topl + "</div>" +
                        "<img src='" + res[i][3] + "' class='xy-mess-face'/>" +
                        "<div class='xy-mess-name'>" + res[i][2] + "</div>" +
                        "<div class='xy-mess-nums'>" + "共" + res[i][1] + "个福娃" + "</div>" +
                        "</a>";
                        "</li>";
						document.body.querySelector('#toplistu').innerHTML += html_top;
                }

                if (!user) {
                    html_my = "<div class='am-cf xy-top-myplace' style='text-align:center;'>目前你未进入排名，请继续加油...</div>";
                    $('#xy-top-myplace').html(html_my);
                }

                $('#yx-top-bg').fadeIn(500, function(){
                    $('#xy-top-myplace').fadeIn(500, function(){
                        $('#toplist').fadeIn(500);
                    });
                });
            }
        });
    });
</script>
</html>